﻿<div class="sidebar">
    <!-- Sidebar Top  -->
    <div class="sidebar_top">
    </div>
    <div class="txt">
        <h2>
            Top 10 Lastest News</h2>
        <hr />
        <ul class="blogList">
            
        </ul>
    </div>
    <!-- Sidebar Bottom -->
    <div class="sidebar_bottom">
    </div>
</div>
@if (false)
{
    <script src="../../Scripts/jquery-1.7.2-vsdoc.js" type="text/javascript"></script>
}
<script type="text/javascript">
    $(document).ready(function () {
        $.ajax({
            url: '@Url.Action("_GetTop10News", "Home")',
            type: 'POST',
            //dataType: 'html',
            success: function (result) {
                // TODO:
                var html = '';
                if (result.length > 0) {
                    for (var i = 0; i < result.length; i++) {
                        html = '';
                        html += '<li>';
                        html += '<span class="span-number">';
                        html += (i + 1);
                        html += '</span>';
                        html += '<a target="_blank" href="' + result[i].Link + '" title="Average Mark:' + result[i].AvgMark + '" >';
                        html += result[i].Title;
                        html += '</a>';
                        html += '</li>';
                        $("ul.blogList").append(html);
                    }
                    $("ul.blogList a[title]").tooltip();
                }
            }
        });
    });
</script>